<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据双向绑定</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="msg" name="文本内容" id="" placeholder="请输入文本内容">
        <span>{{msg}}</span>

        <hr>
        <span>Multiline message is:</span>
        <p style="white-space: pre-line;">{{ message }}</p>
        <br>
        <textarea v-model="message" placeholder="add multiple lines"></textarea>

        <hr>
        <input type="checkbox" id="checkbox" v-model="checked">
        <label for="checkbox">{{ checked }}</label>

        <hr>
        <input type="checkbox" id="jack" value="Jack" v-model="checkedNames">
        <label for="jack">Jack</label>
        <input type="checkbox" id="john" value="John" v-model="checkedNames">
        <label for="john">John</label>
        <input type="checkbox" id="mike" value="Mike" v-model="checkedNames">
        <label for="mike">Mike</label>
        <br>
        <span>Checked names: {{ checkedNames }}</span>
    </div>
</body>
<script src="../js/vue.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data(){
            return {
                msg: '',
                message: '',
                checked: false,
                checkedNames: []
            }
        }
    });
</script>
</html>